Skip to content

upvalue globals#431

Open
Alessandro-Barbieri wants to merge 8 commits intoBreakBB:masterfrom
Alessandro-Barbieri:upvalue
Open

upvalue globals#431
Alessandro-Barbieri wants to merge 8 commits intoBreakBB:masterfrom
Alessandro-Barbieri:upvalue

Conversation

@Alessandro-Barbieri
Copy link
Contributor

@Alessandro-Barbieri Alessandro-Barbieri commented Feb 28, 2026

I'm testing it. For now no issues.

@Alessandro-Barbieri Alessandro-Barbieri marked this pull request as ready for review February 28, 2026 16:45
Copy link
Owner

@BreakBB BreakBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly is the goal of this PR? Just want to make sure I understand what you are trying to achieve.

@Alessandro-Barbieri
Copy link
Contributor Author

What exactly is the goal of this PR? Just want to make sure I understand what you are trying to achieve.

performance, see https://stackoverflow.com/questions/26154960/local-vs-global-in-lua
for example the Ace libraries and the ATT addon do the same

@BreakBB
Copy link
Owner

BreakBB commented Mar 4, 2026

Alright. I know about it, just wanted to make sure I understand the goal since there is explanation on the PR.

Comment on lines +92 to +94
if LeaPlusDB then
local LeaPlusDB = LeaPlusDB
if (LeaPlusDB["DurabilityStatus"] == "On") or PawnInitialize then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the logic, because now with just PawnInitialize the button is not moved at all.

Also this should not be part of this PR.

Comment on lines +111 to +112
local OutfitterButtonFrame = OutfitterButtonFrame
local OutfitterFrame = OutfitterFrame
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what this should do. It doesn't have any positive performance impact, does it?

Comment on lines +120 to +121
local OutfitterButtonFrame = OutfitterButtonFrame
local OutfitterFrame = OutfitterFrame
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

---@class Utils
local Utils = ECSLoader:CreateModule("Utils")

local GetAddOnInfo = C_AddOns and C_AddOns.GetAddOnInfo or GetAddOnInfo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is C_AddOns.GetAddOnInfo available on all client versions?


local _Melee = {}
local _, _, classId = UnitClass("player")
local playerLevel = UnitLevel("player")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't query the player level on top level. Otherwise the values are wrong, once the player levels up.

local _Ranged = {}

local _, _, classId = UnitClass("player")
local playerLevel = UnitLevel("player")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for Melee: We can't query the player level on top level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants